package com.rd.student.jike.class2.lihongming.week731_806.Day0802;

/**
 * @Auther:Heinrich
 * @Date:2023/8/2-08-02-14:23
 * @Description:c230802
 * @version:1.0
 */
public class Store {
    public static Animal getInstance(String type, String name, String chara) {
        if (type.equals("dog")) {
            return new Dog(name, chara);
        } else if (type.equals("pig")) {
            return new Pig(name);
        } else {
            return new Cat(name, chara);
        }
    }
}
